package com.yztstudy.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redisson的配置
 */

@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient()
    {
        // TODO 1.配置
        Config config = new Config();

        // TODO 2.添加地址
        config.useSingleServer().setAddress("redis://192.168.1.3:6379").setPassword("123456");

        // TODO 3.创建客户端
        return Redisson.create(config);
    }
}
